package org.yu.lemon.platform.common.domain;

public enum ResultCodeEnum implements ResultCode {

    /**
     * 定义返回码.
     */
    SUCCESS(200, "操作成功！"),
    INVALID_REQUEST(400, "非法参数！"),
    SYSTEM_ERROR(500, "系统异常，请稍后再试！"),
    FAILED(999, "操作失败！"),

    INVALID_TOKEN(2001,"访问令牌不合法"),
    ACCESS_DENIED(2003,"没有权限访问该资源"),
    CLIENT_AUTHENTICATION_FAILED(1001,"客户端认证失败"),
    USERNAME_OR_PASSWORD_ERROR(1002,"用户名或密码错误"),
    UNSUPPORTED_GRANT_TYPE(1003, "不支持的认证模式");

    private final int code;
    private final String message;

    ResultCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
